<?php

session_start();
include('config.php');

$login = $_POST['login'];
$password = $_POST['password'];

if( $login and $password ){
  if( $login == $config['alogin'] and $password == $config['apass'] ){
    $_SESSION['flycms_login'] = 1;
    $_SESSION['flycms_cache'] = null;
    header('location: index.php');
  } else {
    die('login error.');
  }
 }


?>
<html>
<head>
<title>FLY CMS - Страница администрирования</title>
<link rel="stylesheet" type="text/css" media="all" href="admin_style.css" />
</head>
<body style="text-align: center;">

<div style="width: 200px">
<form action="login.php" method="post">

   <fieldset>
     <legend>Вход</legend>
   
       <div class="field">
         <label>Логин</label>
         <input type="input" id="login" name="login" />
       </div>
       <div class="field">
         <label>Пароль</label>
         <input type="password" id="password" name="password" />
       </div>
       <div class="field">
         <input type="submit" value="Войти >>>" />
       </div>
   </fieldset>


</form>
</div>

</body>
</html>
